<?php

class CCustomWebUser extends CWebUser
{
    public function login($identity, $duration = 0)
    {
        $user = $identity->getUser();
        $user->save();

        parent::login($identity, $duration);    
    }
}